
#ifndef SENDTHREAD_H
#define SENDTHREAD_H
#include"ThreadInterface.h"
class SendThread:public ThreadInterface
{
    Q_OBJECT
public:


    virtual QVector<MyStruct> createStructArray() override;

public:
    SendThread();
    ~SendThread();
    // 重写run()方法
    virtual void run()
    {
        while (1)
        {

            QVector<MyStruct> myArray = createStructArray();

            //process get value :
            foreach(const MyStruct &s, myArray) {
                qDebug() << "ID:" << s.id << ", Name:" << s.name;
            }
            for (int n = 8; n < 15; n++)
            {
                qDebug()<<"11111";
                emit currentValue_signal(myArray,n);
                msleep(1000);
            }

            msleep(1000);
        }
    }
signals:
    void currentValue_signal(QVector<MyStruct> mystructvec,int n);// 定义信号发到主线程
};

#endif // WORKTHREAD_H

